package com.lmt_15;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.Properties;
import java.util.Set;
import java.util.function.Consumer;

public class PropertitesTest {
    public static void main(String[] args) throws Exception {
        Properties properties = new Properties();
        System.out.println(properties);

        properties.load(new FileInputStream("src/com/lmt_15/1.properties"));
        System.out.println(properties);

        System.out.println(properties.getProperty("赵敏")); // 查看某个特殊的键值

        Set<String> set = properties.stringPropertyNames();
        //set.forEach(s->System.out.println(s));
        for (String s : set) {
            System.out.println(properties.getProperty(s));
        }
        properties.forEach((k,v)-> System.out.println(k+ "----->" +v));
    }
}
